import React from 'react' 

import { View } from '@tarojs/components'

import InptSearch from '../../comment/searchInpute'

import Line from '../../comment/upLine'
import Brief from '../../comment/brief'

import './index.scss'

const hotBook = {title:'热门书籍',content:['未来简史','千面英雄','未来简史','千面英雄','未来简史','千面英雄','未来简史','千面英雄'] }
const hotLabel = {title:'热门标签',content:['心理','编程']}
const newBook = {title:'最新书籍',content:['毛概','易经']}
const allArr = [hotBook,hotLabel,newBook]

function RenderLable({renderData,mb='30px'}){
  console.log(renderData)
  return (
    <View className='label-main' style={{marginBottom:mb}}>
      <View className='label-left'>
        {renderData.title}
      </View>
      <View className='label-right'>
        {renderData.content.map((v,i)=>(
          <View key={i}>{v}</View>
        ))}
      </View>
    </View>
  )
}





function search(){
  return (
    <View>
      <Line /> 
      <InptSearch inputSetting={{placeholder:'请输入书籍或其他名称'}} />
      <View className='search-title'>
        {
          allArr.map(v=>(<RenderLable renderData={v} key={v.title} />))
        }
      </View>
      <Brief title='书籍详情' />
    </View>
  )
}




export default search

